home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: sscanf bug??????
- Date: 23 Feb 96 12:57:33 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.825080253@rscernix>
- References: <4fimvo$82s@fnord.dfw.net> <4fqfeo$7mh@umbc9.umbc.edu> <4gh7dc$i2@mailhub.scitec.com.au> <825032700snz@genesis.demon.co.uk>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <825032700snz@genesis.demon.co.uk> Lawrence Kirby <fred@genesis.demon.co.uk> writes:
-
- >However for complete accuracy:
- >
- >int main(void)
- >
- >and
- >
- >main(void)
- >
- >both specify a function that takes no arguments and returns int. Exactly
- >the same amount of compiler checking is required by the C language in
- >both cases.
-
- This is true, but in the first case the compiler will detect errors which
- needn't be detected in the second case, i.e. the famous bad structure
- declaration:
-
- struct foo {
- int bar;
- }
-
- main(void)
-
- Although declaring main as returning void is by far the most common
- mistake, declaring it as returning a struct might happen, as well :-)
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-